Repository navigation
π‘οΈ Sentinel: [MEDIUM] Prevent Zip Bomb / OOM DoS in archive entry inspection - #310
google-labs-jules[bot] wants to merge 1 commit into
Conversation
Unbounded read_to_string on untrusted archive entries could allow crafted zip files to exhaust system memory and cause an OOM crash. Cap reads at 1 MiB using take() and reject oversized entries cleanly.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: MEDIUM
π‘ Vulnerability: Untrusted mod zips scanned or downloaded into the application had their
info.jsonentries decompressed into memory usingRead::read_to_stringwithout an upper bound on decompressed byte length. A malicious or malformed archive entry (zip bomb) could expand indefinitely, exhausting system memory and causing an Out-Of-Memory (OOM) denial-of-service crash.π― Impact: Denial of Service (application crash / system memory exhaustion) upon downloading or scanning a crafted mod zip bomb.
π§ Fix: Added
read_entry_to_string_cappedhelper inmod_store.rsthat caps stream reads at 1 MiB (MAX_INFO_JSON_BYTES + 1) via.take(), rejecting oversized entries cleanly with an error. Applied this to bothmod_store::read_info_jsonanddownloader::verify_mod_zip_sync.β Verification: Added unit tests verifying rejection of entries exceeding 1 MiB in both
mod_storeanddownloader, verified all 143 backend tests pass (cargo test --manifest-path src-tauri/Cargo.toml), and confirmedpnpm buildsucceeds.PR created automatically by Jules for task 17173700962531420412 started by @TheDragonSoft